/**
 * @filename:StkOtherInController Feb 5, 2025
 * @project Wonder Vue Admin Api  1.1.0
 * Copyright(c) 2020 Wonder Co. Ltd.
 * All right reserved.
 */
package com.wonder.app.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wonder.app.domain.PrdFeed;
import com.wonder.app.domain.PrdReportInspect;
import com.wonder.app.request.PrdFeedRequest;
import com.wonder.app.request.PrdReportInspectRequest;
import com.wonder.app.service.PrdFeedService;
import com.wonder.app.service.PrdReportInspectService;
import com.wonder.common.common.AjaxMap;
import com.wonder.common.common.AjaxResult;
import com.wonder.common.common.CommonPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;

@Api(tags = "汇报检验单")
@RestController
@RequestMapping("/app/PrdReportInspect")
public class PrdReportInspectController {

@Autowired
private PrdReportInspectService prdReportInspectService;

    @ApiOperation(value = "汇报检验单列表")
    @RequestMapping(value = "/index", method = RequestMethod.POST)
    public Map<String,Object> index(@RequestBody PrdReportInspectRequest prdReportInspectRequest) {
        Page<PrdReportInspect> page = new Page<PrdReportInspect>(prdReportInspectRequest.getPage(), prdReportInspectRequest.getLimit());
        IPage<PrdReportInspect> list = prdReportInspectService.selectList(prdReportInspectRequest, page);
        Map<String,Object> retMap=new HashMap<>();
        retMap.put("data", CommonPage.restPage(list));
        return AjaxMap.success(retMap);
    }
    /**
     * @explain 查看对象明细
     * @param   map 对象参数：id
     * @return  JsonResult
     * @author  Wonder
     */
    @ApiOperation(value = "查询prdreportinspect明细")
    @ResponseBody
    @PostMapping(value = "/prdreportinspectdetail")

    public AjaxResult<Map<String,Object>> getPrdReportInspectDetail(HttpServletRequest request, @RequestBody Map<String,Object> map) throws Exception{
        if (null == map){
            return AjaxResult.failed("system.parameterError");
        }
        Map<String,Object> data = prdReportInspectService.getPrdReportInspectDetail(map);
        if (null != data){
            return AjaxResult.success(data);
        } else {
            return AjaxResult.failed();
        }
    }

}
